//墙体基本类基础类(10 开始)
//1.生成子弹图片
//2.更换子弹的刚体
//3.负责子弹的移动，或者给力
//4.负责子弹的停止

module py2Obj {


	export class basicWall extends basicObj {
		//保存外部的物理世界

		public constructor(world: any, gamePanle: any, romveSkins: any) {
			super(world, gamePanle, romveSkins);
			this.objkind = 200;

		}

		public init() {
			super.init();


		}


		public createMyRigidbody(): p2.Body {
			var world: P2World = this.m_world;
			var skin: MImage = this.createSkin("left_png");
			var body: p2.Body = world.createBoxBodyShape(skin.width, skin.height, p2.Body.KINEMATIC);

			body.userData.skin = skin;
			body.userData.data = this;
			body.mass = 0;//质量设置为0，就可以按规定方向发射，等发生碰撞之后再给球质量
			//body.gravityScale=0;
			var shape = body.shapes[0];
			//	shape.collisionGroup = 2;//010与001为0，010与110为1
			// shape.collisionMask=2;
			shape.collisionMask = 7;
			// trace(shape.collisionGroup,shape.collisionMask)
			return body;
		}




		public getCollision(otherBody: basicObj) {
			if (otherBody.objkind >= 100 || otherBody.objkind < 200) {
				this.m_removeSkins.push(otherBody.getBody().userData.skin);
				this.m_world.removeBodys.push(otherBody);
			}

		}
	}
}